package com.linked.basemanage.dictionary.service.impl;

import com.linked.basemanage.dictionary.bean.po.DictoryInfoPO;
import com.linked.basemanage.dictionary.mapper.IDictionaryInfoMapper;
import com.linked.basemanage.dictionary.service.IDictionaryHandleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author :dbq
 * @date : 2023/1/13 12:46
 * @description : desc
 */
@Slf4j
@Service
public class DictionaryHandleServiceImpl implements IDictionaryHandleService {

    private final IDictionaryInfoMapper dictionaryInfoMapper;

    public DictionaryHandleServiceImpl(IDictionaryInfoMapper dictionaryInfoMapper) {
        this.dictionaryInfoMapper = dictionaryInfoMapper;
    }

    @Override
    public boolean saveDictoryInfo(DictoryInfoPO param) throws Exception {
        return dictionaryInfoMapper.insert(param) > 0;
    }

    @Override
    public List<DictoryInfoPO> queryDictoryList(String useLocation, String dictionaryCode) throws Exception {
        return dictionaryInfoMapper.queryDictoryList(useLocation, dictionaryCode);
    }
}
